UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Js2t1rcpyiofYoEexrvWt3RCjaJEwv5C9HFK0o+H7eE='
WHERE
key_id = '7de9b0de47c41a3b550036a7b6ec6af2e49b426793032010593172f53421e8b8'
AND (
token = 'Js2t1rcpyiofYoEexrvWt3RCjaJEwv5C9HFK0o+H7eE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)