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