UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9UvIfPPU6ukOOhTn/SpxTpm/nLt2s+im0YIyjtCl9Mg='
WHERE
key_id = '7d0b4716e8c517c8d39dad9e9119c51ee9b4650b9cbafe6d870f28d04bc5be62'
AND (
token = '9UvIfPPU6ukOOhTn/SpxTpm/nLt2s+im0YIyjtCl9Mg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)