UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BDpDLHgexeTwgWVATPyMNqMn5u7YwJZ1izwe5iU32zY='
WHERE
key_id = '2eb3fe3c10ea6fe19d9b940b8a87e3bdf6b73ff8b67ce4a68b6e74b969f5931d'
AND (
token = 'BDpDLHgexeTwgWVATPyMNqMn5u7YwJZ1izwe5iU32zY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)