UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'faF1TCF1CEcikw/st/oRJ/K2IT0/rtFucw1f+u9OpkU=' 
WHERE 
  key_id = '9ddbe51778e7eaa4f0e6b60e3f0a040428f637fc4698b199289c257c3e9f95b6' 
  AND (
    token = 'faF1TCF1CEcikw/st/oRJ/K2IT0/rtFucw1f+u9OpkU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071