UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LxMUTnFFs1c1TgWF+NStPSbGs/MjO8UzBiKynx2QqMs='
WHERE
key_id = '5f36e6b24557eb2c51358cd3f236fccd5580d4316548d41eb4837db98bed1ecc'
AND (
token = 'LxMUTnFFs1c1TgWF+NStPSbGs/MjO8UzBiKynx2QqMs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)