UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vXZJQ7zPlREftaWZLm+lzqPdHw2cpPuuuqenn2WomqQ=' 
WHERE 
  key_id = '735fc1660775e04a7fc45c2e1c164611de51f2c16078a8e9bc37b3a1c3c6e615' 
  AND (
    token = 'vXZJQ7zPlREftaWZLm+lzqPdHw2cpPuuuqenn2WomqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018