UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'br8GU+7i2A9xyy4wnwy1F1cYKqORdOGFPuusHkLeaBI='
WHERE
key_id = '2bca2f1a0c18f2c5269f1aaba406bb6b8fcfe1b3099d4f237d5816186d7e5433'
AND (
token = 'br8GU+7i2A9xyy4wnwy1F1cYKqORdOGFPuusHkLeaBI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)