UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kCd/lXVyJuJ0W7o1Ax/27LYzWXMA/thF1d3Zk3aUhJw=' 
WHERE 
  key_id = '12f582052b630895dd4ba08c9f99f123603ce9c62e41c45d9059838eba804a6e' 
  AND (
    token = 'kCd/lXVyJuJ0W7o1Ax/27LYzWXMA/thF1d3Zk3aUhJw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029