UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e2mmyvjLbdYRk6h7AoTkMl3bTVyd445gmvwibQSy6yU='
WHERE
key_id = 'e7986e030a3d30f635296ba6c342108812c99e426d18b37314edc4d767947307'
AND (
token = 'e2mmyvjLbdYRk6h7AoTkMl3bTVyd445gmvwibQSy6yU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)