UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q/cvFVdi7VrvmEaTo7sQortqwTb2tAHP3Hdm0yc6ydA=' 
WHERE 
  key_id = 'aae22a03e6ffb8756c9363ab0f12a25a27dedc4d64cf7fc94aaeec0806f97339' 
  AND (
    token = 'q/cvFVdi7VrvmEaTo7sQortqwTb2tAHP3Hdm0yc6ydA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031