UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lQGnKMXH+v7LmL5AY30G2u+C2iycKry2oAwpGdqcNIw=' 
WHERE 
  key_id = '46847550024d26812d52779d3090c0b14dc8fbf4676eb45ec8b9f85f75ee95fe' 
  AND (
    token = 'lQGnKMXH+v7LmL5AY30G2u+C2iycKry2oAwpGdqcNIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043