UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vagvg14NYoE5NXMIpgBWysMsViqC1HKNJvgA2wCpsyk=' 
WHERE 
  key_id = '57ddf84a8c44f4ef2dede44890dc4c67bba15403240046df2145812df424e473' 
  AND (
    token = 'vagvg14NYoE5NXMIpgBWysMsViqC1HKNJvgA2wCpsyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015