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

Query time 0.00029