UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2MPDgSnNlpuvq2OuEvF41uwm6lTuxFD/JOCsISX1k2o=' 
WHERE 
  key_id = '450f6f7c28328003e4a671cdaba496a02fcc64bbc68873856130937a29d02732' 
  AND (
    token = '2MPDgSnNlpuvq2OuEvF41uwm6lTuxFD/JOCsISX1k2o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045