UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eh1ykir9WnOIvF61kVrkiwPdIpxjqY2J/i1Kd4faRW8=' 
WHERE 
  key_id = 'd18e620cb9bb77f78f0e6efbd14b0db13db74262e37a54ff4286736f6832b902' 
  AND (
    token = 'eh1ykir9WnOIvF61kVrkiwPdIpxjqY2J/i1Kd4faRW8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043