UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0AXZgrFJjXdLBrobQw7XqJHE5vyXFcCMtPxm7xJLtTU='
WHERE
key_id = '135e8200e80a653f65dd65539cd815d738fc6e35644c3e99a33494d6ce38a5a6'
AND (
token = '0AXZgrFJjXdLBrobQw7XqJHE5vyXFcCMtPxm7xJLtTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)