UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'P0ZbkMShPHDLFWqxXxX7Aw8nCzGZtkiT0q4LRYq+2d4='
WHERE
key_id = '483c56a9de412f9b5de363bec9a9b0084ab1760b205a9d32985ce4c9e090474a'
AND (
token = 'P0ZbkMShPHDLFWqxXxX7Aw8nCzGZtkiT0q4LRYq+2d4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)