UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cjMX+1tmY5X0dCk7uQQyNW+JYR+jYTpgoPkgC83MCec='
WHERE
key_id = '91f3cd807fbc01a0cac4d7e780fb4b768573fc013d0b3250240fef94bb98eb71'
AND (
token = 'cjMX+1tmY5X0dCk7uQQyNW+JYR+jYTpgoPkgC83MCec='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)