UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xVO5ZfievRhvfqFp1hPpc+BOZiDsRdXivFRHukbiQkM=' 
WHERE 
  key_id = '8e6fdea49b0606ee61631936bcb13c566cdfb4d45ce496d1a2d213bf1eedbb1b' 
  AND (
    token = 'xVO5ZfievRhvfqFp1hPpc+BOZiDsRdXivFRHukbiQkM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030