UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDeEHpwewhCeG6rpJbKxKOZKA3bIb77JLDqseiUYVk0='
WHERE
key_id = '5e2c287dfe55ae483c6458ff3e437c097aed0a906c8019dcb3710bee0b954f1c'
AND (
token = 'GDeEHpwewhCeG6rpJbKxKOZKA3bIb77JLDqseiUYVk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)