UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wkLYFfpilZM4BMNCEd0KrNUU8lIfXRYGSDggaCswub0=' 
WHERE 
  key_id = 'eb61d62e09feca64f15c1f188d4b2fee094afaecca4154cd45814fac42804ea1' 
  AND (
    token = 'wkLYFfpilZM4BMNCEd0KrNUU8lIfXRYGSDggaCswub0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030