UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OnHF/NJAiQ/+Erg3JfASZv91E1qNZidT9hwAX9K1des='
WHERE
key_id = '0dcfcf9d271c6a4f0d89b9b148011648b76ba54fc30d825e6b0950bf46df9513'
AND (
token = 'OnHF/NJAiQ/+Erg3JfASZv91E1qNZidT9hwAX9K1des='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)