UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4Bt+3qc3ULcbWXQ9NdTC2nn1cjNUHCjct63opSK2NRI='
WHERE
key_id = 'fee0b2c459e15872d6970baec56d9f7d4469c027c7d9e091dc015b5cec5b293d'
AND (
token = '4Bt+3qc3ULcbWXQ9NdTC2nn1cjNUHCjct63opSK2NRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)