UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nWKkIEdG5EHVvP8UjLqezXHMUMipCOFZKGAtrLSaB4U='
WHERE
key_id = '6a6646f60484b95feb445ed4794c2f38228bd0f71546b4e4c5f8fa5c464c26a2'
AND (
token = 'nWKkIEdG5EHVvP8UjLqezXHMUMipCOFZKGAtrLSaB4U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)