UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3aLL6lJJxGRDdHG1FXkF1BnCYOJtKasXR1/v6ltu2hY='
WHERE
key_id = 'ed4558fe43af5a7c33125648360c9821c9c955bc2570249447423c7bbd80c8a7'
AND (
token = '3aLL6lJJxGRDdHG1FXkF1BnCYOJtKasXR1/v6ltu2hY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)