UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eJut6JU2rf5vGmmcytzRugq3xjlbiWcXbM821UbBFEA=' 
WHERE 
  key_id = '2fd526f392fd2715ef05f8c1a1cf230db5bbebb0406a2083c68f23325bfb86c7' 
  AND (
    token = 'eJut6JU2rf5vGmmcytzRugq3xjlbiWcXbM821UbBFEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040