UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZROcEDEErg3nF9LAvOtLbVUfmuJIR1EiWpHCC1P3LeA='
WHERE
key_id = 'ff33e74cc53fe5a7ab75de98a0c8923646aa7ca52b80e9261590326a8cd35d1e'
AND (
token = 'ZROcEDEErg3nF9LAvOtLbVUfmuJIR1EiWpHCC1P3LeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)