UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MwL1BotnPXy7v/QVbfOms6NQQ4FBnNe3PabJKU0Kgyo='
WHERE
key_id = '4aadbfe95a9c02299ef0989e885f09505f47b2221e566f901f2adc8eae30976b'
AND (
token = 'MwL1BotnPXy7v/QVbfOms6NQQ4FBnNe3PabJKU0Kgyo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)