UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lb5aZkALtpbumRyZXltU1wpsT7/yMKqxiQEqH1826aE='
WHERE
key_id = 'dc1fe5531ac9f3d28eefaba8b19c4fdcd4ab50d8aa6c451b6e99121870ab20bc'
AND (
token = 'lb5aZkALtpbumRyZXltU1wpsT7/yMKqxiQEqH1826aE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)