UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qsD+me2jhZaryZBqz+FBEtK3UjMOfu5kohLC3si/LUo=' 
WHERE 
  key_id = 'e8320878015c4ea1804c0db256a3b627631874d1f3ac162510539bc38b5ac3e5' 
  AND (
    token = 'qsD+me2jhZaryZBqz+FBEtK3UjMOfu5kohLC3si/LUo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037