UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RXpIW58BnidK6wm/uUyaU/2JuvFGd/PqeQljDWurAlY='
WHERE
key_id = '1fcff4858afcadccbbfdf2a02d6e38880a2edaa8112b6a7b914769874b07d91f'
AND (
token = 'RXpIW58BnidK6wm/uUyaU/2JuvFGd/PqeQljDWurAlY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)