UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Y+75AFad4J5ZiNC0Y9qlOQ1El/+GoEdRfPPG3ixe2W4='
WHERE
key_id = '900d84ec12474c405fe4b0b09863bf97614659a44dec2049d4c87cf7b324bbe1'
AND (
token = 'Y+75AFad4J5ZiNC0Y9qlOQ1El/+GoEdRfPPG3ixe2W4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)