UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2yb7V63kCZu22YvsSe/ECjUkH3mQimQSg1eciPwogdY=' 
WHERE 
  key_id = '5ad808a0431de1ec666b3bd699c3a09286ee3b1a659036ca1ed0828f45f14397' 
  AND (
    token = '2yb7V63kCZu22YvsSe/ECjUkH3mQimQSg1eciPwogdY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034