UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sUkaT7lTiQK9U9e7k4M0mFZFwx5pqtPP4Uh2xMM2AZE=' 
WHERE 
  key_id = 'bb058a43cf355752fc426a94295d75e3bb3e0c0bc76fc91a5c3aaaf12a9511a0' 
  AND (
    token = 'sUkaT7lTiQK9U9e7k4M0mFZFwx5pqtPP4Uh2xMM2AZE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032