UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ghniyvCVlG7RFcsckYLgbnM89Bqf5bSxfS866UY7luY='
WHERE
key_id = '1f2908b1b50eae7c028e24dbf353399934a82b55cdc7c2c23f76398aae46ebe2'
AND (
token = 'ghniyvCVlG7RFcsckYLgbnM89Bqf5bSxfS866UY7luY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)