UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Z9jfn+xq82gpIc7m7wCbYbnkvAJ6GNndVrV9U0DZ3sw='
WHERE
key_id = 'a80fd27d7b8d8fc8f6b64f9650406671e786936cbfd27dff7f03e70ba28ed5ae'
AND (
token = 'Z9jfn+xq82gpIc7m7wCbYbnkvAJ6GNndVrV9U0DZ3sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)