UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rNQGztSPlMXtXehecGgwwhBSz+fw9KWAMmoW5NEjnWg='
WHERE
key_id = 'b357ac46ee631aafbe0e57a4a9771378bd0207cb847d2db7984740d08a39f69b'
AND (
token = 'rNQGztSPlMXtXehecGgwwhBSz+fw9KWAMmoW5NEjnWg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)