UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XUuRy85FeGudxxxnlY3K9etqktjo0enLRqmw1vBqZng='
WHERE
key_id = '94a51ad1fd25eea0f2efe3811d2ce848f80d6173d139df8f24e4f555815f56a1'
AND (
token = 'XUuRy85FeGudxxxnlY3K9etqktjo0enLRqmw1vBqZng='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)