UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FDBa8QCqjv9cUufUt8//aj1wl0mF1xydr1PzuXQhYzM=' 
WHERE 
  key_id = '72527bac15305a60b89885e3437fc58d74220a4959e158d56f4abcd0bcfd7a9c' 
  AND (
    token = 'FDBa8QCqjv9cUufUt8//aj1wl0mF1xydr1PzuXQhYzM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023