UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nJOinTYTVyZLQ3yUjy17p5WaH15IR+0/6+fjmhpZsTI='
WHERE
key_id = '2b7a3ba69901b1c8dfdad6e55074fb3ac38c87f37eb2b8d448a0ec9577e4afa5'
AND (
token = 'nJOinTYTVyZLQ3yUjy17p5WaH15IR+0/6+fjmhpZsTI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)