UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'S+pU2MW84bIicrgAtFaeAXRSSzPXmUz4bvM2AG4QygQ=' 
WHERE 
  key_id = '05fa9c61429983af081c49a06b9cccdf7b4ce0606ca67e84583436c0bb5cad2d' 
  AND (
    token = 'S+pU2MW84bIicrgAtFaeAXRSSzPXmUz4bvM2AG4QygQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048