UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mB7IcKvVibgwBe7V1HS17m6dBccac510wrBZxqQvKSY=' 
WHERE 
  key_id = '67e5b8f18391743a3bf445f40e9271af6563e608cbf62ea1a4f98a820cb70dda' 
  AND (
    token = 'mB7IcKvVibgwBe7V1HS17m6dBccac510wrBZxqQvKSY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037