UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5WFKX4dpC9BW/m0YzrvUjtxXoAuauIb1gJVDcWQCBx8='
WHERE
key_id = '47373782e6adadfcb0a36673aab6f42055a3eb9bdb542f12531ab0739888d625'
AND (
token = '5WFKX4dpC9BW/m0YzrvUjtxXoAuauIb1gJVDcWQCBx8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)