UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rTSB7fSxx/5CTrPXpVaCF/ZbRwNDxZ4q5P4AnxSuYtc=' 
WHERE 
  key_id = '900328b42f8fa1e007c92800e60fab9e0f89b1f982197d8d6604ee72e7df3472' 
  AND (
    token = 'rTSB7fSxx/5CTrPXpVaCF/ZbRwNDxZ4q5P4AnxSuYtc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035