UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2x4oNmn0KHsMAtyiteFXqwavXURJ/lfKmAyWC9MI11M=' 
WHERE 
  key_id = '895151eb3f6da4df7847e2cfb5be7aaa767a54a0103aa5a3cc1a63729d7c8f37' 
  AND (
    token = '2x4oNmn0KHsMAtyiteFXqwavXURJ/lfKmAyWC9MI11M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030