UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MVoC4MeOmmXZYgrUxRKrItgajYpYtWYjwQXvremzv6c='
WHERE
key_id = '997f94d3ad4ccaf19709cc3f4f50cd361940c9c26cbd232441bdcd5abb4d6f13'
AND (
token = 'MVoC4MeOmmXZYgrUxRKrItgajYpYtWYjwQXvremzv6c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)